import os
from os.path import join


def get_all_files(directory: str) -> list[str]:
    res = []
    if os.path.isdir(directory):
        for root, dirs, files in os.walk(directory):
            for file in files:
                f = join(root, file)
                res.append(f)
    return res


if __name__ == '__main__':
    directory = r'D:\迅雷下载'
    files = get_all_files(directory)
    print(len(files))
